﻿@model WorldArtPrice.Models.PricesDetailModel
@{
    ViewBag.Title = "Detail";
}
<noscript>
	<style>
		.es-carousel ul{
			display:block;
		}
	</style>
</noscript>
<script id="img-wrapper-tmpl" type="text/x-jquery-tmpl">	
	<div class="rg-image-wrapper" style="margin-left: 0px; padding-top: 0px; width: 320px;">	
        {{if itemsCount > 1}}
					<div class="rg-image-nav">
						<a href="#" class="rg-image-nav-prev">Previous Image</a>
						<a href="#" class="rg-image-nav-next">Next Image</a>
					</div>
				{{/if}}			
		<div class="rg-image" style="margin-left: 25px; margin-right: 0px;width: 250px;"></div>
		<div class="rg-loading"></div>
	</div>
</script>
<script src="/Scripts/gallery.js"></script>
<script src="/Scripts/tmpl.js"></script>
<script src="/Scripts/easing.js"></script>
<script src="/Scripts/elastislide.js"></script>
<div id="results">
<div id="saleInfoContainer" class="clearfix" style="margin-left: 0px; margin-right: 0px; padding-top: 10px; padding-bottom: 0px;">
    <div class="p-v1" style="margin-left: 0px; margin-right: 10px; width: 340px;">
        <div class="p-content">
            <h1 class="content-hed content-hed-v1 h1 graphic-txt-v1 ucase">
                @(HttpUtility.HtmlDecode(Model.Price.ItemName))</h1>
            <ul class="list info-list clearfix">
                <li class="info-item list-item" style="height:auto">
                    <b>Artist:</b> @(HttpUtility.HtmlDecode(Model.Artist.FullName)) 
                    (@(Model.Artist.Born == 0 ? "Born unknown" : Model.Artist.Born.ToString()) - @(Model.Artist.Died == 0 ? "Die unknown" : Model.Artist.Died.ToString()))
                    @Model.Artist.Country
                </li>
            </ul>
            <ul class="list info-list clearfix">
                <li class="info-item list-item">
                    <b>Auction result:</b> @(Model.Price.Unsold ? " Unsold" : CommandLib.Utils.ConvertMoney(Model.Price.Price.ToString()) + " "+ Model.PriceCurrency.Currency)
                </li>
                <li class="info-item list-item" style="padding-left: 0px;">
                    <b>Medium:</b> @Model.ItemType.Name @Model.Price.ItemTypeDescription
                </li>
                @{
                    string Estimated = "N/A";
                    if ((Model.Price.EstimatedTo < 1 || Model.Price.EstimatedTo == null) && (Model.Price.EstimatedFrom > 0)) { Estimated = CommandLib.Utils.ConvertMoney(Model.Price.EstimatedFrom.ToString()) + " " + Model.EstimatedCurrency.Currency; }
                    if ((Model.Price.EstimatedFrom < 1 || Model.Price.EstimatedFrom == null) && (Model.Price.EstimatedTo > 0)) { Estimated = CommandLib.Utils.ConvertMoney(Model.Price.EstimatedTo.ToString()) + " " + Model.EstimatedCurrency.Currency; }
                    if (Model.Price.EstimatedFrom > 0 && Model.Price.EstimatedTo > 0) { Estimated = CommandLib.Utils.ConvertMoney(Model.Price.EstimatedFrom.ToString()) + " - " + CommandLib.Utils.ConvertMoney(Model.Price.EstimatedTo.ToString()) + " " + Model.EstimatedCurrency.Currency; }
                    if (Model.Price.EstimatedFrom == null && Model.Price.EstimatedTo == null) { Estimated = "N/A"; }       
                }                                     
                <li class="info-item list-item" style="padding-left: 0px;">
                    <b>Estimated price:</b> @Estimated
                </li>
                <li class="info-item list-item" style="padding-left: 0px;height:auto">
                    <b>Size (H x W x D):</b> 
                    @{
                        decimal  H=Model.Price.Height == null ? 0 : Model.Price.Height;
                        decimal  W=Model.Price.Width == null ? 0 : Model.Price.Width;
                        decimal  D=Model.Price.Depth == null ? 0 : Model.Price.Depth;
                        string size="";
                        if(Model.Price.Measurement == "cm")
                        {
                            if(D==0)
                            {        
                                size = (Math.Round((double)H/2.54,1) +" x " + Math.Round((double)W/2.54,1) +" in / "+ H +" x "+ W +" cm").Replace("0 x 0 in / 0 x 0 cm", "N/A");                     
                                
                            }
                            else
                            {
                                size = (Math.Round((double)H/2.54,1) +" x " + Math.Round((double)W/2.54,1) + " x "+ Math.Round((double)D/2.54,1) +" in / "+H+" x "+W+" x "+D+" cm").Replace("0 x 0 x 0 in / 0 x 0 x 0 cm", "N/A");                                                               
                            }
                        }
                        else
                        {                                                                                
                            if(D==0)
                            {
                                size = (Math.Round((double)H*2.54,1) +" x " + Math.Round((double)W*2.54,1) +" in / "+ H +" x "+ W +" cm").Replace("0 x 0 in / 0 x 0 cm", "N/A");                               
                            }
                            else
                            {
                                size = (Math.Round((double)H*2.54,1) +" x " + Math.Round((double)W*2.54,1) + " x "+ Math.Round((double)D*2.54,1) +" in / "+H+" x "+W+" x "+D+" cm").Replace("0 x 0 x 0 in / 0 x 0 x 0 cm", "N/A");                                
                            }
                        }
                    }
                    <span>@size</span>
                </li>
            </ul>
            <ul class="list info-list clearfix">
                <li class="info-item list-item">
                    <b>Auction time:</b> @Model.Price.AuctionTime.ToString("dd-MM-yyyy")</li>
                <li class="info-item list-item" style="padding-left: 0px;height:auto">
                    <b>Auction house:</b>
                    <a href="@Model.AuctionHouse.Link" target="_blank">@(Model.AuctionHouse.Name + " - " + Model.AuctionHouseSublocation.Name)</a>
                </li>
            </ul>
        </div>
        <div class="clearer"></div>                                                     
    </div>                     
    <div class="s-v2" style="margin-right: 0px; margin-left: 0px; margin-bottom: 10px;">
        <div class="related-items">
            <div class="hd" id="img-wrap">                                
                     <div class="container" style="float: left; height: 540px; margin-left: 5px; width: 300px;">
			            <!-- header -->
			
			            <div class="content" style="margin-left: 0px; margin-right: 0px;">
				
				            <div id="rg-gallery" class="rg-gallery" style="margin-left: 0px; width: 300px; margin-right: 0px;">					
					            <div class="rg-thumbs" style="margin-left: 0px; right: 0px; margin-right: 0px; width: 360px;">
						            <!-- Elastislide Carousel Thumbnail Viewer -->
						            <div class="es-carousel-wrapper" style="margin-left: 0px; padding-left: 0px; padding-bottom: 0px;">							            							
							            <div class="es-carousel" style="width: 290px; height: 100px; margin-left: 19px;">
								            <ul style="padding-left: 0px;">
                                                @foreach(var item in Model.ListArtWork)
                                                {
                                                    string urlImage = CommandLib.Config.UrlImage + CommandLib.Parameter.IMAGE_ARTWORK + "/" + item.ArtworkId + "/"+ item.ArtworkFile.Substring(item.ArtworkFile.LastIndexOf("/")+1);
									                <li><a href="#"><img src="@urlImage" data-large="@urlImage"/></a></li>									            
                                                }
								            </ul>
							            </div>
						            </div>
						            <!-- End Elastislide Carousel Thumbnail Viewer -->
					            </div><!-- rg-thumbs -->
				            </div>
			            </div><!-- content -->
		            </div>
            </div>
        </div>
    </div>
</div>
    </div>


